-- GENERATED SPELL FOR [Hazzali Swarmer] --


function spell0_5451(pUnit, Event) --@Silithid Swarm,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(6589,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_5451', 1, 1)
end

function spell1_5451(pUnit, Event) --@Silithid Swarm,Self--
pUnit:FullCastSpellOnTarget(10722,pUnit)
pUnit:RegisterEvent('Sorts_5451', 592, 1)
end

function Sorts_5451(pUnit, Event)
local choix_sorts_5451 = math.random(0, 1)
if choix_sorts_5451 == 0 then
pUnit:RegisterEvent('spell0_5451', 1, 1)
end
if choix_sorts_5451 == 1 then
pUnit:RegisterEvent('spell1_5451', 1, 1)
end
end

function mob5451_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5451', math.random(1500, 3000), 1)
end

function mob5451_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5451_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5451_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5451, 1, 'mob5451_Action')
RegisterUnitEvent(5451, 2, 'mob5451_Leave')
RegisterUnitEvent(5451, 3, 'mob5451_Kill')
RegisterUnitEvent(5451, 4, 'mob5451_Die')
